<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    /* 线性渐变 沿着某条直线朝一个方向产生渐变效果 */
    .box1 {
        width: 300px;
        height: 200px;
        background: linear-gradient(45deg , red ,orange , green ) ;
    }
    .box2 {
        width: 300px;
        height: 200px;
        background: linear-gradient(to left, skyblue ,orange , green ) ;
    }

    /* 重复渐变 */
    .box3 {
        width: 300px;
        height: 200px;
        background: repeating-linear-gradient(to right,red 5%,blue 15%,yellow 20% ) ;
    }

    /* 径向渐变  */
    .box4 {
        width: 300px;
        height: 200px;
        background: radial-gradient(circle at center , blue 20% ,green 20% ,yellow 50%);
    }
    .box5 {
        width: 300px;
        height: 200px;
        background: repeating-radial-gradient(circle at center,#f00 0,#f00 10%,#ff0  20%,#ff0 10%);
    }

</style>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div>
</body>
</html>